#
#   Hello World client in Python
#   Connects REQ socket to tcp://localhost:5555
#   Sends "Hello" to server, expects "World" back
#
import zmq

import middleman

context = zmq.Context()

#  Socket to talk to server
print "Connecting to hello world server..."
socket = context.socket(zmq.REQ)
socket.connect ("tcp://localhost:5556")

newGameReq = middleman.NewGameRequest("Game #1", 2)

print(newGameReq)

raw_input("press enter")

print "Sending request ", newGameReq, "..."
    
socket.send(newGameReq.serialize())

#  Get the reply.
message = socket.recv()
print "Received reply ", newGameReq, "[", message, "]"